<!DOCTYPE HTML>
<html  xmlns:th="http://www.thymeleaf.org">
<head th:include="_meta :: header">
    <title>添加</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <!--<form class="layui-form form form-horizontal"  id="form-audio-add" action="#" th:action="@{/admin/audio/addAudio}">


            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>上传视频：</label>
                <div class="imgcon" style="float:left;">
                </div>
                <input type="hidden" value="" name="meetingIcon" class="goods_img"  >
                <div class="addimg" style="float: left ;"  >
                    <div id="drag" class="" title="将文件拖拽到此处上传" >
                        <label for="fileupload" title="点击上传">
                            <img th:src="@{/xadmin/images/add.png}" style="height: 100px;width: 100px;"  alt="">
                            <input id="videoUrl"  type="hidden"  name="videoUrl" />
                        </label>
                    </div>
                    <input style="display: none" id="fileupload" type="file"  name="file"
                           multiple="multiple" data-url="/admin/fileUpload">
                </div>
            </div>








            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>稿件id：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input" t name="draftId"  placeholder="修改稿件id" id="draftId"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>音频地址：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input" t name="audioUrl"  placeholder="修改音频地址" id="audioUrl"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>提交时间：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input timeSpace" readonly="readonly"
                           autocomplete="off" name="submitTime" placeholder="请选择提交时间"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>音频制作人：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input" t name="audioPerple"  placeholder="修改音频制作人" id="audioPerple"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>音频时长：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input" t name="audioLength"  placeholder="修改音频时长" id="audioLength"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>状态code：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input" t name="statusCode"  placeholder="修改状态code" id="statusCode"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>是否删除(0是1否)：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input" t name="isDelete"  placeholder="修改是否删除(0是1否)" id="isDelete"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>创建时间：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input timeSpace" readonly="readonly"
                           autocomplete="off" name="createTime" placeholder="请选择创建时间"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="x-red">*</span>修改时间：</label>
                <div class="layui-input-inline">
                    <input type="layui-input" class="layui-input timeSpace" readonly="readonly"
                           autocomplete="off" name="updateTime" placeholder="请选择修改时间"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">
                </label>
                <button  class="layui-btn" id="subbtn" type="submit" >
                    增加
                </button>

            </div>
        </form>-->
        <label for="fileupload" title="点击上传">
            <a title="上传"
               class="ml-5" style="text-decoration:none"><i class="layui-icon">&#xe67c;</i></a>
        </label>
        <input style="display: none" id="fileupload" type="file"  name="file"
               multiple="multiple" accept="application/vnd.sealed-ppt"  th:data-url="${'/admin/fileUpload/ppt?id='+draft.id}">
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs"></div>
<div th:replace="_ueditor :: ueditor"></div>
<!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script>
    layui.use(['form', 'layer','laydate'],function() {
        $ = layui.jquery;
        var form = layui.form,
            laydate = layui.laydate,
            layer = layui.layer;
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,trigger: 'click'
                ,type: 'datetime'
            });
        });
    });
    $(function(){
        $("#form-audio-add").validate({
            rules:{
                draftId:{
                    required: true,
                },
                audioUrl:{
                    required: true,
                },
                submitTime:{
                    required: true,
                },
                audioPerple:{
                    required: true,
                },
                audioLength:{
                    required: true,
                },
                statusCode:{
                    required: true,
                },
                isDelete:{
                    required: true,
                },
                createTime:{
                    required: true,
                },
                updateTime:{
                    required: true,
                },
            },
            onkeyup:false,
            debug: true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'POST',
                    url: "/admin/audio/addAudio" ,
                    success: function(data){
                        if(data.code == "1"){
                            selfmsg('添加成功!',1,function(){
                                var index = parent.layer.getFrameIndex(window.name);
                                parent.location.reload();
                                parent.layer.close(index);
                            });
                        }else{
                            selfmsg('添加失败!');
                        }
                    },
                    error: function(){
                        selfmsg('添加异常!',5);
                    }
                });
            }
        });
    });

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>